import React from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import { adminRoutes } from '../router';
import './App.css';
import Frame from '../components/Frame/index.jsx';

function App() {
  return (
    <Frame>
      <Switch>
        {adminRoutes.map(route => {
          return (
            <Route
              key={route.path}
              path={route.path}
              exact={route.exact}
              render={routeProps => {
                return <route.component {...routeProps} />;
              }}
            />
          );
        })}
      </Switch>
    </Frame>
  );
}

export default App;
